<nav class="navbar navbar-default" role="navigation">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-navbar-collapse-1">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
	<a class="navbar-brand" href="../index.php">Home</a>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="bs-navbar-collapse-1">
      <ul class="nav navbar-nav">
      	<li><a href="main.php">Round Result</a></li>
        <li><a href="standings.php">Standings</a></li>
        <li><a href="history.php">History</a></li>
        <li><a href="timetable.php">Timetable</a></li>
        <?php session_start();
			if (isset($_SESSION['login'])){
				if ($_SESSION['teamID']==1){ ?>
                <li class="dropdown">
				<a class="dropdown-toggle " data-toggle="dropdown" href="#">Coach <b class="caret"></b></a>
                	<ul class="dropdown-menu">
                      <li><a href="coach.php">Update Results</a></li>
                      <li><a href="add_fillin.php">Fill-in</a></li>
                      <li><a href="add_finals.php">Create Final</a></li>
                      <li class="divider"></li>
                      <li><a href="add_player.php">Manage Players</a></li>
                      <li><a href="add_team.php">Manage Teams</a></li>
                      <li class="divider"></li>                      
                    </ul>
                 </li>	
			<?php } else {?>
            <li><a href="input_result.php">Umpire</a></li><?php } }?> </li>
      </ul>
     <?php 
			if (isset($_SESSION['login'])){?> 
        <form class="navbar-form navbar-right" role="form" action="logout.php" method="post">
          <label>Welcome <?php echo $_SESSION['login'];?>&nbsp;&nbsp;&nbsp;</label>
          <button name="submit">Logout</button>
        </form>
            <?php }	else { ?>   
        <form class="navbar-form navbar-right" role="form" action="login.php" method="post">
           <?php 
			if ($_SESSION['login_failed']){?>
            <label>Login failed</label>
			<?php $_SESSION['login_failed']=false;}	?>
          <input type="text" name="username" id="username" placeholder="user name" />
          <input type="password" name="password" id="password" placeholder="password" />
          <button name="submit">Login</button>
        </form>
        <?php }?>
    </div><!-- /.navbar-collapse -->
    
    
  </div><!-- /.container-fluid -->
</nav>

